|
|
|
|
|
|
|
The File Open dialog box is shown in Figure 11.7. The File Save As dialog box is essentially the same box, except the title reads Save As. |
|
|
|
|
|
|
|
|
Figure 11.7
The File Open dialog box from the common dialog control. |
|
|
|
|
|
|
|
|
This dialog box is generated by the following code: |
|
|
|
 |
|
|
|
|
Private Sub cmdFileOpen_Click()
Dim strFiles As String
cdlCommon.InitDir = App.Path
' NOTE: Don't put spaces by the Pipe character!
cdlCommon.Filter = "Access Databases (*.mdb)|*.mdb|" & _
"INI Files (*.ini)|*.ini|" & _
"All Files (*.*)|*.*"
cdlCommon.Flags = cdlOFNAllowMultiselect + _
cdlOFNLongNames + _
cdlOFNExplorer
cdlCommon.MaxFileSize = 3000
cdlCommon.ShowOpen
strFiles = cdlCommon.FileName
txtFileOpen.Text = strFiles
End Sub |
|
|
|
|
|
|
|
|
To use this sample you need to add the common dialog control from the Project, Components menu and set the Name property to ctlCommon. |
|
|
|
|
|